OpenBuildings GenerativeComponents Help

Spaces

Generally, the GCScript language processor ignores spaces and line breaks that occur between adjacent symbols. You should use as much or as little spacing as you wish, to make your script code readable to yourself and others.

From GCScript's point of view, all of the following examples are identical. Which example is best depends on your own taste and programming style.

Example 1

(temperature-32)/1.8

Example 2

(temperature – 32) / 1.8 
(temperature /* Fahrenheit */ - 32) / 1.8  // Convert
to Celsius.

Example 3

/* Convert the temperature from degrees
Fahrenheit to degrees Celsius using the 
standard formula, C = (F – 32) / 1.8. */

Example 4

(
	temperature //Start with the value in degrees
Fahrenheit.
	- 32   //Adjust it so that the freezing
point of water is at zero.
)
/ 1.8         //
Then scale it so that it's degrees Celsius.